{#
  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at https://mozilla.org/MPL/2.0/.
 #}

{% macro firefox_download_desktop_button_windows(cta_copy=ftl('download-button-download-now'), id='download-button-desktop-release-win', build='32', position='primary cta') -%}
  {% set class_name = 'os_win' if build == '32' else 'os_win64' %}
  {% set os = 'win' if build == '32' else 'win64' %}
  <div class="firefox-platform-button-windows">
    <div class="firefox-platform-button">
      <a class="download-link {{ class_name }} mzp-t-xl mzp-c-button mzp-t-product ga-product-download"
        id="{{ id }}"
        href="{{ settings.BOUNCER_URL }}?product=firefox-stub&os={{ os }}&lang={{ LANG }}"
        data-download-version="{{ os }}"
        data-cta-text="Download Now"
        data-cta-type="firefox"
        data-cta-position="{{ position }}"
        data-testid="{{ id }}"
        >
        <strong class="download-title">
          {{ cta_copy }}
        </strong>
      </a>

      <small class="mzp-c-button-download-privacy-link">
        <a href="{{ url('privacy.notices.firefox') }}">
          {{ ftl('download-button-firefox-privacy-notice') }}
        </a>
      </small>
    </div>

    {# ESR download buttons to display on unsupported systems: issue 13317 #}
    {% with channel_name = 'Firefox' %}
      {% include 'firefox/includes/download-unsupported.html' %}
    {% endwith %}
  </div>
{%- endmacro %}


{% macro firefox_download_desktop_button_mac(cta_copy=ftl('download-button-download-now'), id='download-button-desktop-release-osx', position='primary cta') -%}
{% set DOWNLOAD_LANG = "ja-JP-mac" if LANG == "ja" else LANG %}

  <div class="firefox-platform-button-mac">
    <div class="firefox-platform-button">
      <a class="download-link os_osx mzp-t-xl mzp-c-button mzp-t-product ga-product-download"
        id="{{ id }}" href="{{ settings.BOUNCER_URL }}?product=firefox-latest-ssl&os=osx&lang={{ DOWNLOAD_LANG }}"
        data-download-version="osx"
        data-cta-text="Download Now"
        data-cta-type="firefox"
        data-cta-position="{{ position }}"
        data-testid="{{ id }}"
        >
        <strong class="download-title">
          {{ cta_copy }}
        </strong>
      </a>

      <small class="mzp-c-button-download-privacy-link">
        <a href="{{ url('privacy.notices.firefox') }}">
          {{ ftl('download-button-firefox-privacy-notice') }}
        </a>
      </small>
    </div>

    {# ESR download buttons to display on unsupported systems: issue 13317 #}
    {% with channel_name = 'Firefox' %}
      {% include 'firefox/includes/download-unsupported.html' %}
    {% endwith %}
  </div>
{%- endmacro %}


{% macro firefox_download_desktop_button_linux(cta_copy=ftl('download-button-download-now'), id='download-button-desktop-release-linux', position='primary cta') -%}
  <div class="firefox-platform-button-linux">
    <div class="firefox-platform-button">

      {% comment %}
      <a class="download-link os_linux mzp-t-xl mzp-c-button mzp-t-product ga-product-download" id="{{ id }}" href="{{ settings.BOUNCER_URL }}?product=firefox-latest-ssl&os=linux&lang={{ LANG }}" data-download-version="linux" data-cta-text="Download for Linux 32-bit" data-cta-position="{{ position }}" data-testid="{{ id }}">
        <strong class="download-title">
          {{ ftl('download-button-linux-32-v2') }}
        </strong>
      </a>
      {% endcomment %}

      <a class="download-link os_linux64 mzp-t-xl mzp-c-button mzp-t-product ga-product-download" id="{{ id }}-64" href="{{ settings.BOUNCER_URL }}?product=firefox-latest-ssl&os=linux64&lang={{ LANG }}" data-download-version="linux64" data-cta-text="Download for Linux 64-bit" data-cta-position="{{ position }}" data-testid="{{ id }}-64">
        <strong class="download-title">
          {{ ftl('download-button-linux-64-v2') }}
        </strong>
      </a>

      <p class="c-linux-debian">{{ ftl('download-button-using-debian', attrs='href="https://support.mozilla.org/kb/install-firefox-linux#w_install-firefox-deb-package-for-debian-based-distributions" rel="external noopener"
      data-cta-text="You can set up our APT repository instead"')}}</p>

      <small class="mzp-c-button-download-privacy-link">
        <a href="{{ url('privacy.notices.firefox') }}">
          {{ ftl('download-button-firefox-privacy-notice') }}
        </a>
      </small>
    </div>
  </div>
{%- endmacro %}
